| None. |
|
The two-word spelling of EndIf. End If and EndIf are the same keyword to the compiler; use whichever reads better to you. Both close a multi-line If block, including all of its ElseIf and Else branches. The two-word style pairs naturally with Else If, and matches the other block terminators in the language - End Function, End Type, End Select - so it is the more consistent choice if you like your blocks to look alike. As with EndIf, a single-line If ... Then statement does not take one. See also: EndIf, If, Else, Else If, Then. |
; End If Example
; --------------
; The pilot's status after the last battle
hull=65
If hull>=75 Then
Print "Hull at "+hull+"% - all systems go!"
ElseIf hull>=40 Then
Print "Hull at "+hull+"% - fly carefully out there."
Else
Print "Hull at "+hull+"% - return to base immediately!"
; End If closes the whole If block (it may also be written as EndIf)
End If
Print ""
Print "Press any key to close the example"
WaitKey
End